<?php date_default_timezone_set("Asia/Calcutta");?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
 <meta name="apple-mobile-web-app-capable" content="yes" />
<title><?php echo $page_title ?></title>
<!-- css file -->
<link href="<?= $this->config->base_url(); ?>assets/css/bootstrap-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/bootstrap-red.css" type="text/css" charset="utf-8" />


<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/site.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/sidemenu.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/fullcalendar.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/datepicker.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/table.css" type="text/css" charset="utf-8" />
<!--<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/demo_table_jui.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/pform.css" type="text/css" charset="utf-8" />-->
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/chosen.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/font-awesome.min.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/slider.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/hover-style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/bootstrap-select.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="<?= $this->config->base_url(); ?>assets/css/chat.css" type="text/css" charset="utf-8" />

<!-- javascripts file -->
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery-1.8.1.min.js"></script>
<!--<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery-1.9.2.js"></script>-->

<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/bootstrap.min.js"></script>
<!--<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery.timeago.js"></script>
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery.livequery.js"></script>-->
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/bootstrap-select.min.js"></script>

<!--for chat-->
<!--<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/chat.js"></script>-->

<!--for tag input in worksheet page-->
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery.tagInput.js"></script>
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery.timers.js"></script>


<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jasny-bootstrap.min.js"></script>
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery.clock.js"></script>
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/fullcalendar.js"></script>
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery.dataTables.js"></script>
<!--<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery.psteps.min.js"></script>-->


<!--<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery.timer.js"></script>-->
<!--<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/bootstrap-timepicker.min.js"></script>-->
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/chosen.jquery.js"></script>
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/function.js"></script>
<!--<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/steps.js"></script>-->

<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery-1.js"></script>
<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/ckeditor/ckeditor.js"></script>

<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/jquery-ui-1.7.1.custom.min.js"></script>


<script type="text/javascript" src="<?= $this->config->base_url(); ?>assets/js/common.js"></script>


</head>
<body>

<div class="container-fluid">
<!-- The loading box -->
	<div id="loading-overlay"></div>
	<div id="loading">
		<span>Loading...</span>
	</div>
	<!-- End of loading box -->
<!-- Errors -->
<div class="navbar navbar-fixed-top">
              <div class="navbar-inner">
                <div class="container" style="width: auto; padding: 0 20px;">
                  <a class="brand" href="#">Fedobe</a>
                  <ul class="nav">
      <?php //if($this->ion_auth->is_admin())
				//{?>            
                    <!--<li><a href="<?= site_url('founder/founder');?>"><i class="icon-dashboard"></i> Dashboard</a></li>-->
                 <!--  <li class="dropdown">
                     <a class="dropdown-toggle" data-toggle="dropdown" href="<?= site_url('home/home');?>">
					 <span class="badge badge-info"> 
					 <?php
					$notif = $this->ion_auth->get_unread_notification(10);
					  echo $count_notif = count($notif);?> 
					 </span> 
					 Notification <b class="caret"></b></a> 
                       <ul class="dropdown-menu">
                       <?php foreach($notif as $notification) {?>
					   <li>
					   <a href="<?php echo site_url($notification->url)?>"> 					  
					   <?php echo ' '.$notification->desc.' '.$notification->created_date; ?> </a>
					   
					   </li>
					   <?php }?>
                       <li class="divider"></li>
                       <li><a href="<?php echo site_url('user/notification')?>">View all notification .. </a></li>
                       </ul>
                    </li>-->
                     <?php // }?>
                       <?php if($this->ion_auth->in_group('members'))
							{?>            
                    <li><a href="<?= site_url('user/user');?>">Dashboard</a></li>
                    <li><a href="<?= site_url('user/user');?>"><span class="badge badge-important">6</span> Notification </a> </li>
                     <?php }?>
                    </ul>                                       
                 <ul class="nav pull-right">
					<li><a href="#"><i class="icon-bell"></i></a></li>
					<li><a href="<?php echo site_url('user/user/mail')?>"><i class="icon-envelope"></i> </a></li>
                    <li class="dropdown">                      
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-cog icon-white"></i> Settings <b class="caret"></b></a>
                        <ul class="dropdown-menu">
						<?php if(!$this->ion_auth->is_client()):?>
						<li><a href="<?=site_url('user/wall');?>"><i class="icon-cog icon-white"></i> Account Settings</a></li>
						<li><a href="<?= site_url('user/aboutme/addabout');?>"><i class="icon-user icon-white"></i> Edit About Me</a></li>
						<?php endif;?>
						
						<?php if($this->ion_auth->is_admin())
							{?>                
                         <li><a href="<?= site_url('founder/user/user_type');?>">Create User Type</a></li>   
                         <li><a href="<?= site_url('founder/user/department');?>">Create Department</a></li>
						                                                    
                         <li><a href="<?= site_url('user/tasks/default_milestone');?>">Create default milestones</a></li>
                         <li><a href="<?= site_url('user/tasks/default_taskgroup');?>">Create default task groups</a></li>   
                           
                          <li class="divider"></li>
                          <li><a href="#">Help</a></li>
                          <?php }?> 
                        </ul>
                      </li>                     
                      <li><a href="<?= site_url('auth/logout');?>">Logout</a></li>
                    </ul> 
                </div>
              </div>
            </div>
          
<!-- Menu -->
<!--<h2>Welcome <?= $this->session->userdata('username');?></h2>-->
<div class="row-fluid">
	<div class="breadcrum_lines">	
<div class="row-fluid">
<div class="span2"></div>
<div class="span6" style="border-left: 3px double #ccc;padding: 10px">
	<!--Menu -->
	<?php if($this->ion_auth->is_admin()) {?> 

<a href="<?= site_url('user/tasks/create_task')?>"><i class="icon-plus"></i> Create Task</a> /
<!--<a href="<?= site_url('founder/holidays')?>"><i class="icon-plus-sign"></i> Create To Do</a> -->
&nbsp;<a href="<?= site_url('user/to_do/view/'.$this->session->userdata('user_id').'/'.date('m').'/'.date('y'))?>"><i class="icon-plus-sign"></i> Create To Do</a>


<?php } elseif($this->ion_auth->is_client()) { ?>

<a href="<?= site_url('user/tasks/create_task');?>"> <i class="icon-plus"></i> Create Task</a>

<?php } else {?>

<a href="#attendancemodel" role="button" data-toggle="modal" class="attendance_add_popup"><i class="icon-calendar"></i> Atttendance</a> |
<a href="<?= site_url('user/tasks/create_task');?>"> <i class="icon-plus"></i> Create Task</a> |
<a href="<?= site_url('user/to_do/view/'.$this->session->userdata('user_id').'/'.date('m').'/'.date('y'))?>"><i class="icon-plus-sign"></i> Create To Do</a>

<?php }?>
	
</div>
<div class="span4" style="#ccc;padding: 10px">
<!--Time Part-->
	<strong>
<i class="icon-time"></i><span class="digital-clock">	
 <span class="hour "></span>
	   <span class="min"></span>
        <span class="sec"></span>
        <span class="meridiem"></span>
     	</span>
<span class=""><i class="icon-calendar"></i> <?= date('l, F d, Y'); ?></span> &nbsp;</strong>
</div>
</div>
</div>
</div>
<div class="row-fluid">
<div class="sidebar span2">
<div>
<div class="profile">
<div class="username">
  Wazzup, <?= ucfirst($this->session->userdata('username'));?> !  	
</div>
  
<!--<a href="<?php if(!$this->ion_auth->is_client()):?><?=site_url('user/wall');?> <?php endif;?>">-->
<a href="<?php if(!$this->ion_auth->is_client() && !$this->ion_auth->is_admin()):?><?=site_url('user/wallpage/viewwall');?> <?php endif;?>">
  <?php if(!$this->session->userdata('profile_image'))
  {?>
	 <img class="img-polaroid" src="<?= $this->config->base_url();?>assets/images/users.png" /><br>
  <?php } else { ?>
	<img class="img-polaroid" width="85%" height="" src="<?= $this->config->base_url();?>assets/uploads/<?= $this->session->userdata('profile_image');?>" /><br>  
  <?php }?>
 
  </a>
  <ul class="user-links">
			            	<li><a href="#" title="">Tasks<strong class="pull-right text-error">+12</strong></a></li>
			            	<li><a href="#" title="">Todo<strong class="pull-right text-error">+156</strong></a></li>
			            	<li><a href="#" title="">Goals<strong class="pull-right text-error">+45</strong></a></li>
			            </ul>
  <div>
</div>
</div>
<!--Side menu starts here -->
                <div class="accordion" id="leftMenu">                    
					<?php if($this->ion_auth->is_admin()) { ?>					
					<div class="accordion-group">
                        <div class="accordion-heading">
                            <a class="accordion-toggle"  href="<?= site_url('founder/founder');?>">
                                  <i class="icon-home"></i> Dashboard
                            </a>
                        </div>
                    </div>					
					<?php } elseif ($this->ion_auth->is_client()) { ?>					
					<div class="accordion-group">
                        <div class="accordion-heading">
                            <a class="accordion-toggle"  href="<?= site_url('client/client');?>">
                                  <i class="icon-home"></i> Dashboard
                            </a>
                        </div>
                    </div>					
					<?php } else {?>					
					<div class="accordion-group">
                        <div class="accordion-heading">
                            <a class="accordion-toggle"   href="<?= site_url('user/user');?>">
                                  <i class="icon-home"></i> Dashboard
                            </a>
                        </div>
                    </div>					
					<?php }?>					
					<?php
					$group_id =  $this->ion_auth->get_user_group();
					$menu_heading = $this->ion_auth->get_menu_heading($group_id);
					foreach($menu_heading as $mh){						
					$hurl = trim($this->uri->uri_string());
					// getting the heading id by url
					 $heading_id = $this->ion_auth->get_menu_heading_ID($hurl);
					//print_r($heading_id);
					if($mh->id == $heading_id){ ?>
					<script>
				$(document).ready(function() {
   				 $('#collapse<?php echo $mh->id ?>').collapse('show');
					});
					</script>
					<?php }
					?>					
                    <div class="accordion-group">
                        <div class="accordion-heading">
                            <a class="accordion-toggle" data-toggle="collapse" data-parent="#leftMenu" href="#collapse<?php echo $mh->id ?>">
                                <i class="<?php echo $mh->icon?>"></i> <?php echo $mh->name?> 
                            </a>
                        </div>
						<?php $main_menu = $this->ion_auth->get_menu_by_group_id($group_id,$mh->id);
						if(count($main_menu)){
						?>
                        <div id="collapse<?php echo $mh->id ?>" class="accordion-body collapse" style="height: 0px;">
                            <div class="accordion-inner">
							<ul>							
							<?php foreach($main_menu as $mm){
								$urls = $mm['url'];
								$sID = array($this->session->userdata('user_id'),date('y'),date('m'),date('d'));
								$url_array = array("this->session->userdata('user_id')","date('y')","date('m')","date('d')");
								$mm['url'] =  str_replace($url_array,$sID ,$urls);								
								 ?>								
							<li><a href="<?php echo site_url('/'.$mm['url']); ?>" <?php if($hurl==$mm['url']){ echo 'style="color:#dc2335;"'; }?> ><i class="<?php echo $mm['icon']; ?>"></i> <?php echo $mm['name']; ?></a></li>
											
											<?php 
												$child_menus = $this->ion_auth->get_child_menu_by_group_id($group_id,$mm['id']);
												if(count($child_menus)>0){?>
											<ul style="padding-left: 15px;" class="childmenu">
												<?php foreach($child_menus as $cm) { ?>
												<li><a href="<?php echo site_url($cm->url)?>"><i class="<?php echo $cm->icon?>"></i> <?php echo $cm->name?></a></li>
												<?php } ?>
											</ul>							
											
							<?php }} ?>
							</ul>
                            </div>
                        </div>
						<?php }?>
                    </div>
					
					<?php  }?>
                    
                </div>				
				<?php 
				$data = array(
               3  => 'http://example.com/news/article/2006/03/',
               7  => 'http://example.com/news/article/2006/07/',
               18 => 'http://example.com/news/article/2006/13/',
               26 => 'http://example.com/news/article/2006/26/'
             );
				echo $this->calendar->generate(2013,10,$data); ?>
				</div>
		
</div>
<div class="span10 main_body" style="min-height: 900px;">
<input  type="hidden" value="<?= site_url()?>" id="site_url"/>
